package com.njxz.demo.controller;


import com.njxz.demo.domain.Vo.BorrowingBooksVo;
import com.njxz.demo.domain.result.Result;
import com.njxz.demo.service.IBorrowingBooksRecordService;
import com.njxz.demo.utils.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/admin/bookBorrow")
@CrossOrigin
public class AdminBookBorrowController {
    @Autowired
    private IBorrowingBooksRecordService borrowingBooksRecordService;
    /**
     * 返回所有用户借书记录页面
     * @return
     */
    @GetMapping("/allBorrowBooksRecord")
    public Result getAllBorrowBooksRecord(@RequestParam("pageNum") int pageNum){
        Page<BorrowingBooksVo> page=borrowingBooksRecordService.selectAllByPage(pageNum);
        if (page!=null){
            return Result.ok(page);
        }
        return Result.fail("查询失败");
    }
}
